﻿<UserControl x:Class="CountJobTags.DataBoundSmiley"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             d:DesignHeight="300" d:DesignWidth="300">

    <Image>
        <Image.Source>
            <DrawingImage>
                <DrawingImage.Drawing>
                    <DrawingGroup>
                        <!-- The yellow face -->
                        <GeometryDrawing>
                            <GeometryDrawing.Geometry>
                                <EllipseGeometry RadiusX="12.5" RadiusY="12.5" Center="6.25, 6.25"  />
                            </GeometryDrawing.Geometry>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="Gold" Offset="0"/>
                                    <GradientStop Color="Yellow" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                        </GeometryDrawing>

                        <!-- The Smile, which is the only variable part-->
                        <GeometryDrawing Brush="White" Geometry="{Binding GeometryString}">
                            <GeometryDrawing.Pen>
                                <Pen Brush="RosyBrown" Thickness="1" />
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>

                        <!-- The eyes-->
                        <GeometryDrawing Brush="DarkBlue">
                            <GeometryDrawing.Pen>
                                <Pen Brush="White" Thickness="1.5" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <!-- Left eye-->
                                    <EllipseGeometry RadiusX="2" RadiusY="2.5" Center="2,5" />
                                    <!-- Right eye-->
                                    <EllipseGeometry RadiusX="2" RadiusY="2.5" Center="10.5, 5" />
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingGroup>
                </DrawingImage.Drawing>
            </DrawingImage>
        </Image.Source>
    </Image>
</UserControl>
